<!DOCTYPE html>
<html>
<head>
    <title>资源添加</title>
    <#include "/common/import.ftl" >
    <script type="text/javascript">
        $(function () {
            $('#inputForm').form({
                url: '${ctx}/uct/lock/save.action',
                onSubmit: function () {
                    return $("#inputForm").form("validate");
                },
                success: function (data) {
                    var result = jQuery.parseJSON(data);
                    if (result.flag == 'T') {
                        $.messager.alert('提交结果', result.msg, 'info', function () {
                            parent.closeAddWin();
                        });
                        parent.reload();
                    } else {
                        $.messager.alert('提交结果', '操作失败:' + result.msg, 'info');
                    }
                }
            });
            $('#actId').combotree('setValue', '${item.actId!""}');
        });
    </script>
</head>
<body>
<div id="tip">
    <form id="inputForm" name="inputForm" method="post" action="${ctx}/uct/lock/save.action">
        <input type="hidden" name="formToken" id="formToken" value="${formToken!''}">
        <input type="hidden" name="lockId" id="lockId" value="${item.lockId!''}"/>
        <input type="hidden" name="sysId" id="sysId" value="${item.sysId!''}"/>
        <input type="hidden" name="sysEname" id="sysEname" value="${item.sysEname!''}"/>
        <table class="datagrid-body">
            <tr>
                <td class="datagrid-header">资源名称<span style="color:red;">*</span></td>
                <td>
                    <input name="lockCname" id="lockCname" value="${item.lockCname!''}"
                           class="easyui-validatebox"
                           data-options="required:true,validType:'length[1,200]'" size="50"
                           missingMessage="请输入名称" invalidMessage="应为1~200个字"/>
                </td>
            </tr>

            <tr>
                <td class="datagrid-header">资源类型<span style="color:red;">*</span></td>
                <td>
                    <input type="radio" name="lockType" id="Strick" value="Strick"
                           checked="checked"/>严格锁
                    <input type="radio" name="lockType" id="Child" value="Child"/>子孙锁
                    <input type="radio" name="lockType" id="Father" value="Father"/>父辈锁
                    <input type="radio" name="lockType" id="Family" value="Family"/>家族锁
                </td>
            </tr>

            <tr>
                <td class="datagrid-header">资源路径</td>
                <td>
                    <input id="lockPath" name="lockPath" value="${item.lockPath!''}"
                           class="easyui-validatebox" size="50"
                           data-options="required:false,validType:'length[1,200]'"
                           invalidMessage="应为1~200个字"/>
                </td>
            </tr>

            <tr>
                <td class="datagrid-header">对应权限</td>
                <td>
                    <input id="actId" name="actId" class="easyui-combotree"
                           url="${ctx}/uct/act/act!actTree.action?actId=${item.actId!''}&sysEname=${item.sysEname!''}"
                           editable="true" data-options="required:false" style="width:250px;">
                </td>
            </tr>

            <tr>
                <td class="datagrid-header">状态<span style="color:red;">*</span></td>
                <td>
                    <input type="radio" name="lockStatus" id="lockStatus_1" value="1"/>启用
                    <input type="radio" name="lockStatus" id="lockStatus_0" value="0"/>停用
                </td>
            </tr>

            <tr>
                <td class="datagrid-header"></td>
                <td>
                    <a href="#" class="easyui-linkbutton" iconCls="icon-save"
                       onClick="$('#inputForm').submit();">提交</a>
                </td>
            </tr>
        </table>
    </form>
</div>
</body>
</html>


<script>
    initRadio("lockStatus", "${item.lockStatus!''}");
    initRadio("lockType", "${item.lockType!''}");
</script>